﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin-site.Master" AutoEventWireup="true" CodeBehind="ManageAnnouncements.aspx.cs" Inherits="CodeCamp12.admin.ManageAnnouncements" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">

<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />

<script src="../Scripts/ManageAnnouncements.js" type="text/javascript"></script>
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" runat="server">

<div id="announcementWrapper">
    <h2>Here you can add new html pages or edit/delete existing pages for the codecamp events</h2>
    <div id="manageAnnouncements">
    
    <br />
    <br />
    <a href="AnnouncementDetails.aspx" style="font-size:medium; font-weight:bold;">Add new html page</a>
    <br />
    <br />
    <br />
    <h3>Existing html pages in the database</h3>
    <div id="AnnouncementTemp">
   
    </div>
    </div>
    

    <div id="HomePageAnnouncements">
        <br />
        <br />
        <a href="#" style="font-size:medium; font-weight:bold;" onclick="openDialog();">Add new notification</a>
        <br />
        <br />
        <br />
        <h3>Home page notifications</h3>
        <div id="notTemp">
            

        </div>
        
    </div>
</div>


<div id="insertNotification">
    Add new notification for home page!
    <form id="validateNotification" method="get" action="">
        <table>
            <tr>
                <td>Title:</td><td><input type="text" id="txtTitle" name="notificationtitle" /></td>
            </tr>
            <tr>
                <td>Date:</td><td><input type="text" id="txtDate" name="notificationdate" /></td>
            </tr>
            <tr>
               <td>Redirect to:</td><td><input type="text" id="linkToPage" name="notiflinktopage" /></td>
            </tr>
        
        </table>
        Short description:
        <br />
        <textarea id="txtDescription" name="notificationdesc"></textarea>
        <br />
        <button id="btnAdd" type="submit" onclick="insertNotification();">Add</button>
        <button id="btnCancel" type="button" onclick="closeDialog();">Cancel</button>
    </form>
</div>

 <script id="AnnouncementTemplate" type="text/x-jQuery-tmpl">
            <div class='AnDiv'>
                <div class='divInfo'>
           
                 <a href="../AnnouncementDetails.aspx?id=${ID}"><strong> ${Title} </strong></a>
                 <br />
                      <strong>Posted on:&nbsp; </strong>[${Date}]
                </div>
                <br /><br />
                <div class="divButtons">       
                            [<a href="AnnouncementDetails.aspx?id=${ID}" id="btnEdit"  class="link_butt">Edit</a>] |
                            [<a href="" id="btnDelete" class="link_butt" onclick="DeleteAnn('${ID}');">Delete</a>]
                </div> 
            </div>
       </script>
       
       <script id="NotificationTemplate" type="text/x-jQuery-tmpl">
            <div class='AnDiv'>
                <div class='divInfo'>
                    <a href="${Link}" title="${Description}"><strong>${Title}</strong></a>
                    <br />
                    <strong>Posted on:&nbsp; </strong>[${Date}]
                </div>
                <br /><br />
                <div class="divButtons">       
                    [<a href="" onclick="DeleteNotification('${ID}')" class="link_butt">Delete</a>]
                </div> 
            </div>
       </script>
</asp:Content>
